'use strict';

import Base from './base.js';

export default class extends Base {
  /**
   * index action
   * @return {Promise} []
   */
  indexAction(){
    //auto render template file index_index.html
    return this.display();
  }
  // async redirectAction(){
  //     return this.displayView('index_redirect');
  // }
  async loginAction(){
    //auto render template file index_index.html
    // let data=this.post();
    // let md5Pas = await think.md5(data.password);
    // let uname = await data.username;
    // let result=await this.model("user").where({name:uname,role:{"<":4}}).find();
    //
    // console.log("result",result.name)
    // console.log("result",result.password)
    //
    // let info={
    //       name: uname,
    //       password: md5Pas
    // }
    // if(uname===result.name&&md5Pas===result.password){
    //       await this.session("userInfo", info);
    //       return this.json({status:1,msg:"登录成功!"});
    // }else{
    //     return this.json({status:0,msg:"用户名或密码错误!admin"});
    // }
    return this.display();
  }
}
